use "CO10p_VoterValidation.dta", clearhist R_PTOP_10 if p10 == 1hist D_PTOP_10 if p10 == 1hist R_PTOP_10 if GOPSmple == 1hist D_PTOP_10 if DemSmple == 1xtile dem=D_PTOP_10, nquantiles(100)xtile rep=R_PTOP_10, nquantiles(100)bys dem: egen mean_prob_dem = mean(D_PTOP_10)bys rep: egen mean_prob_rep = mean(R_PTOP_10)bys dem: egen mean_turnout_dem = mean(p10)bys rep: egen mean_turnout_rep = mean(p10)gen difference_dem = abs(mean_prob_dem - mean_turnout_dem)gen difference_rep = abs(mean_prob_rep - mean_turnout_rep)bys dem: gen N=_n==1bys rep: gen M=_n==1egen wae_dem = total(difference_dem) if N==1replace wae_dem = wae_dem / 100egen wae_rep = total(difference_rep) if M==1replace wae_rep = wae_rep / 100sort wae_rep wae_dembrowse wae_rep wae_dem